import axios from 'axios'
import Cookies from 'js-cookie'
import { baseApi } from '@/config'

export function upload(data) {
  // var data = new FormData()
  // data.append('file', file)
  // const config = {
  //   headers: { 'Authorization': Cookies.get('Token') ,'content-type': 'multipart/form-data; boundary=---011000010111000001101001'}
  // }
  // return axios.post(baseApi + api, data, config)
  const options = {
    headers: { 'Authorization': Cookies.get('Token') ,'content-type': 'multipart/form-data; boundary=---011000010111000001101001'},
    url: baseApi + '/uploads/',
    method: 'post',
    data: data
    
  }
  return axios.request(options,data)
}




